//
//  HPYEmoticonPageViewCell.swift
//  SwiftVVBo
//
//  Created by hepeiyong on 16/8/18.
//  Copyright © 2016年 hpyhn. All rights reserved.
//

import UIKit

class HPYEmoticonPageViewCell: UICollectionViewCell {

    var indexPath: NSIndexPath?{
        didSet{
            // 设置text
            messageLabel.text = "第\(indexPath?.section ?? 0)组\n第\(indexPath?.item ?? 0)页"
        }
    }


    override init(frame: CGRect) {
        super.init(frame: frame)
        setupUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    // MARK: - 设置视图
    private func setupUI(){
        backgroundColor = RandomColor()
        // 添加控件
        contentView.addSubview(messageLabel)
        // 添加约束
        messageLabel.snp_makeConstraints { (make) -> Void in
            make.center.equalTo(contentView)
        }
    }

    // MARK: - 懒加载控件
    private lazy var messageLabel: UILabel = UILabel(textColor: UIColor.redColor(), textSize: 35, maxWidth: SCREENW)
}
